<HTML><HEAD><TITLE>deleteff(-Min, +List, -Rest)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(sd)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>deleteff(-Min, +List, -Rest)</H1>
Pick minimum domain size element from a list (first fail principle)
<DL>
<DT><EM>Min</EM></DT>
<DD>Smallest list element in terms of domain size
</DD>
<DT><EM>List</EM></DT>
<DD>List of domain variables or constants
</DD>
<DT><EM>Rest</EM></DT>
<DD>Remaining list without smallest element
</DD>
</DL>
<H2>Description</H2>

	Extracts from a list of domain variables (or constants) the first
	element with the smallest domain. This element is returned as Min,
	and the remaining list without this element is returned as Rest.
	This predicate is useful for implementing the first-fail-principle
	in a search procedure, i.e. labeling the variable with the smallest
	domain first. E.g.
	<PRE>
	labelingff(List) :-
		( deleteff(X, List, Rest) ->
		    indomain(X),
		    labelingff(Rest)
		;
		    true
		).
	</PRE>

<H3>Fail Conditions</H3>
List is empty
<H2>See Also</H2>
<A HREF="../../lib/sd/get_domain_size-2.html">get_domain_size / 2</A>
</BODY></HTML>
